/* 多媒体预览样式 */

.media-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* 预览窗口内的导航按钮 */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 15;
    opacity: 0.8;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.nav-btn span {
    display: block;
    line-height: 1;
}

.media-preview-container {
    background: white;
    border-radius: 12px;
    width: 90vw;
    height: 90vh;
    max-width: 1500px;
    max-height: 1000px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative; /* 确保内部绝对定位元素相对于此容器定位 */
}

.media-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.media-preview-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    margin-right: 16px;
}

.media-preview-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #409EFF;
    color: white;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #337ecc;
    transform: scale(1.05);
}

.close-btn {
    background: #f56c6c;
}

.close-btn:hover {
    background: #f23030;
}

.media-preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
}

/* 图片预览样式 */
.image-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 20px;
    user-select: none;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    transform-origin: center center;
}

/* 图片内部控制栏 */
.image-controls-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    opacity: 0.8;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.image-container:hover .image-controls-overlay {
    opacity: 1;
}

.zoom-btn-overlay {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.zoom-btn-overlay:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.zoom-btn-overlay:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.zoom-info-overlay {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: white;
    font-size: 14px;
}

/* 视频预览样式 */
.video-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.video-preview video {
    max-width: 100%;
    max-height: calc(100% - 40px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.video-info {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* 音频预览样式 */
.audio-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 30px;
}

.audio-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.audio-icon {
    font-size: 64px;
    color: #409EFF;
}

.audio-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    max-width: 400px;
    word-break: break-all;
    line-height: 1.4;
}

.audio-duration {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.audio-size {
    font-size: 14px;
    color: #999;
    margin-top: 3px;
}

.audio-preview audio {
    width: 100%;
    max-width: 500px;
    height: 54px;
}

/* 不支持的文件类型样式 */
.unsupported-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: #666;
    padding: 40px;
    text-align: center;
}

.unsupported-icon {
    font-size: 64px;
    color: #ccc;
}

.unsupported-text {
    font-size: 18px;
    color: #999;
}

.file-info {
    font-size: 16px;
    color: #666;
    max-width: 400px;
    word-break: break-all;
    line-height: 1.4;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .media-preview-container {
        width: 95vw;
        height: 95vh;
        max-width: none;
        max-height: none;
    }
    
    .media-preview-header {
        padding: 12px 16px;
    }
    
    .media-preview-title {
        font-size: 14px;
    }
    
    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    /* 移动端导航按钮调整 */
    .nav-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .prev-btn {
        left: 15px;
    }
    
    .next-btn {
        right: 15px;
    }
    
    /* 移动端图片控制栏调整 */
    .image-controls-overlay {
        padding: 6px 12px;
        gap: 10px;
    }
    
    .zoom-btn-overlay {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .zoom-info-overlay {
        font-size: 12px;
        min-width: 40px;
    }
    
    .image-preview,
    .video-preview {
        padding: 15px;
    }
    
    .audio-preview {
        padding: 20px;
        gap: 20px;
    }
    
    .audio-icon {
        font-size: 48px;
    }
    
    .audio-name {
        font-size: 16px;
    }
    
    .unsupported-icon {
        font-size: 48px;
    }
    
    .unsupported-text {
        font-size: 16px;
    }
    
    .file-info {
        font-size: 14px;
    }
}

/* 更小屏幕的适配 */
@media (max-width: 480px) {
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
    
    .image-controls-overlay {
        bottom: 15px;
        padding: 5px 10px;
        gap: 8px;
    }
    
    .zoom-btn-overlay {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #999;
    font-size: 16px;
}

/* 错误状态 */
.error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #e74c3c;
    padding: 40px;
    text-align: center;
}

.error-icon {
    font-size: 48px;
}

.error-text {
    font-size: 16px;
}

.error-message {
    background: #ffeaa7;
    color: #d63031;
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #fdcb6e;
}